// Problem 048: Self powers
// The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317.
// Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.

package main

import (
	"fmt"
	"math/big"
)

func p048() {
	var n *big.Int
	s := big.NewInt(0)
	t := big.NewInt(10000000000)
	for i := 1; i <= 1000; i++ {
		n = big.NewInt(int64(i))
		n.Exp(n, n, t)
		s.Add(s, n)
	}
	s.Mod(s, t)
	fmt.Println("Problem 048:", s.String())
}
